<template>
  <div>
    <TinyMCE v-model="content" @contentChange="contentChange" />

    <el-button type="primary" @click="getContent">获取内容</el-button>
    <div v-html="viewHtml" />

    <el-input v-model="inputContent" placeholder="" />
    <el-button type="primary" @click="setContent">保存</el-button>
  </div>
</template>
<script>
import TinyMCE from '@/components/TinyMCE'

export default {
  components: { TinyMCE },
  data() {
    return {
      content: '234',
      viewHtml: '',
      inputContent: ''
    }
  },
  methods: {
    setContent() {
      this.content = this.inputContent
    },
    getContent() {
      this.viewHtml = this.content
      console.log(this.content)
    },
    contentChange(v) {
      console.log('contentChange')
      console.log(v)
    }
  }
}
</script>
